<template>
  <div>
    <div class="model2">
      <div class="photo">
        <p
          style="
            font-size: 42px;
            font-family: DFLiJinHeiW8-GB, DFLiJinHeiW8-GB-Regular;
            font-weight: 400;
            text-align: center;
            color: #279e70;
            line-height: 120px;
                margin: 0;
          "
        >
          {{attractlis.name}}
        </p>
      </div>
      <div style="font-size: 20px;margin-top:-20px;">
        <span style="margin-right:20px;">营业时间：  {{attractlis.bustime}}</span>
        <span style="margin-right:20px;">评星：  {{attractlis.stat}}</span>
        <span style="margin-right:20px;">营业状态：
          <span v-if="attractlis.status == 1">营业中</span>
          <span v-else>休息中</span>
        </span>
      </div>
      <div class="bzjd1">
        <div class="textStyle" v-html="attractlis.content">
        </div>
      </div>
      <div class="pmgd">
        <div class="pmgdxc">
          <div style="width:99%;height:150px;padding:10px;background:#fff;">
            <!-- <div v-for="(item,index) in list" :key="index" @click="hqxq(item)">
              <img :src="item.url" style="width:295px;height:150px;margin-left:10px;" />
            </div> -->
            <carousel :per-page="6" :loop="true" :autoplay="true" :autoplay-timeout="3000">
                <slide v-for="(item, index) in list" :key="index">
                    <img :src="item.url" alt="Image" @click="openLightbox(index,item)" />
                </slide>
            </carousel>
          </div>
        </div>
      </div>

      <div class="bzjd">
        <div class="box1" v-for="(item,index) in video" :key="index" @click="jdxq(item)" style="margin-top: 20px;">
          <div style="width: 100%;">
            <video :src="item.url" controls :poster="item.pic" style="width: 100%; height: 100%" ></video>
          </div>
          <div style="width: 100%;">
            <div>
              <p
                style="
                  font-size: 16px;
                  font-family: PingFang SC, PingFang SC-Semibold;
                  font-weight: 600;
                  color: #000000;
                  line-height: 32px;
                  overflow: hidden;
                  display: -webkit-box;
                  -webkit-line-clamp: 1;
                  -webkit-box-orient: vertical;
                  text-overflow: ellipsis;
                  padding: 0 15px;
                "
              >
                 {{item.name}}
              </p>
            </div>
          </div>
        </div>
      </div>

    </div>

    <el-dialog  :visible.sync="isLightboxOpen">
      <img width="100%"  :src="lightboxImages" alt="">
    </el-dialog>
  </div>
</template>
<script>
import { Carousel, Slide } from 'vue-carousel'
import { service } from '@/request'
import VueSeamlessScroll from 'vue-seamless-scroll'
// import { service } from "@/request";
export default {
  components: {
    VueSeamlessScroll,
    Carousel,
    Slide
  },
  data () {
    return {
      routId: '',
      attractlis: {},
      list: [],
      video: [],
      lightboxImages: '../assets/image/1.png',
      isLightboxOpen: false,
      lightboxIndex: 0
    }
  },
  created () {},
  mounted () {
    this.routId = this.$route.query.id
    this.routId = Number(this.routId)
    this.getList()
    this.getPhoto()
    this.getVideo()
  },
  methods: {
    openLightbox (index, item) {
      console.log('123312')
      this.lightboxImages = item.url
      this.lightboxIndex = index
      this.isLightboxOpen = true
    },
    closeLightbox () {
      this.isLightboxOpen = false
    },
    getVideo () {
      service({
        url: '/go/attractvedio',
        method: 'post',
        data: { id: this.routId }
      }).then((res) => {
        if (res.code == 200) {
          this.video = res.data
        }
      })
    },
    getPhoto () {
      service({
        url: '/go/attractpic',
        method: 'post',
        data: { id: this.routId }
      }).then((res) => {
        if (res.code == 200) {
          this.list = res.data
        }
      })
    },
    getList () {
      service({
        url: '/go/attractdetail',
        method: 'post',
        data: { id: this.routId }
      }).then((res) => {
        if (res.code == 200) {
          this.attractlis = res.data
        }
      })
    }
  }
}
</script>
<style scoped>
.pmgd {
  width: 99%;
  height: 50%;
  display: flex;
  justify-content: center;
}
.pmgdxc {
  width: 99%;
  height: 210px;
  margin-top: 33px;
}
.xzdsp{
  height: 408px;
  display: flex;
  justify-content: space-around;
  align-content: center;
  align-items: center;
  align-items: center;

}
.xspz{
  width: 300px;
  height: 260px;
  display: inline-block;
  background: url('../assets/image/x1.png') no-repeat;
  background-size: 100% 100%;
}
.dsp{
  width: 500px;
  height: 300px;
  display: inline-block;
  background: url('../assets/image/d1.png') no-repeat;
  background-size: 100% 100%;
}
.xspy{
  width: 300px;
  height: 260px;
  display: inline-block;
  background: url('../assets/image/x2.png') no-repeat;
  background-size: 100% 100%;
}
.textStyle {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  font-size: 16px;
  font-family: Source Han Sans SC, Source Han Sans SC-Regular;
  font-weight: 400;
  text-align: left;
  color: #000000;
  line-height: 28px;
  text-indent: 2em;
}
.model1 {
  width: 99.9%;
  height: 600px;
  background: url("../assets/image/dpm1.png") no-repeat;
  background-size: 100% 100%;
}
.sywz {
  font-size: 49px;
  font-family: PingFang SC, PingFang SC-Semibold;
  font-weight: 600;
  text-align: center;
  color: #ffffff;
  margin-top: 0;
}
.model2 {
  width: 99.9%;
  min-height: 693px;
  display: flex;
  justify-content: center;
  align-content: center;
  align-items: center;
  background: url('../assets/image/dbj2.png') no-repeat;
  background-size: 100% 100%;
  flex-direction: column;
  padding-bottom: 15px;
}

.bzjd1 {
  width: 70%;
  height: 60%;
  /* display: flex; */
  /* justify-content: space-between; */
}
.box1 {
  width: 30%;
  height: 100%;
  display: inline-block;
  background: #fff;
  /* border: 1px solid black; */
}

.photo {
  height: 158px;
  text-align: center;
  background: url("../assets/image/gysq.png") no-repeat;
  background-size: 100% 100%;
  display: flex;
  justify-content: center;
}
/deep/ .el-carousel__container {
    position: relative;
    height: 600px;
}
 .imdt{
  width: 100%;
  height: 100%;

 }
.medium2{
position: absolute;
    left: 5rem;
    bottom: 10rem;
    font-size: 50px;
    color: white;
    /* text-decoration-line: underline; */
    font-weight: 900;
    font-family:Georgia, 'Times New Roman', Times, serif;
    font-size: 48px;
    line-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: none;
    order: 1;
    align-self: stretch;

}
.medium1{
    position: absolute;
    left: 5rem;
    bottom: 15rem;
    font-size: 50px;
    color: white;
    /* text-decoration-line: underline; */
    font-weight: 900;
    font-family:Georgia, 'Times New Roman', Times, serif;
    font-size: 48px;
    line-height: 100%;
    display: flex;
    align-items: center;
    flex: none;
    order: 1;
    align-self: stretch;
}
.scroll-container {
  width: 99%;
  height: 150px;
  overflow: hidden;
}

.scroll-content {
  display: flex;
  animation-name: scroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

img {
  width: 295px;
  height: 150px;
  margin-left: 10px;
}
/deep/ .VueCarousel-dot{
    display: inline-block;
    cursor: pointer;
    appearance: none;
    border: none;
    background-clip: content-box;
    box-sizing: content-box;
    padding: 0;
    border-radius: 100%;
    outline: none;
    display: none;
}
.bzjd {
  width: 70%;
  height: 60%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

</style>
